//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.activiti.engine.impl.persistence.entity;

import java.util.Iterator;
import java.util.List;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.activiti.engine.impl.persistence.entity.data.DataManager;
import org.activiti.engine.impl.persistence.entity.data.HistoricIdentityLinkDataManager;

public class HistoricIdentityLinkEntityManagerImpl extends AbstractEntityManager<HistoricIdentityLinkEntity> implements HistoricIdentityLinkEntityManager {
  protected HistoricIdentityLinkDataManager historicIdentityLinkDataManager;

  public HistoricIdentityLinkEntityManagerImpl(ProcessEngineConfigurationImpl processEngineConfiguration, HistoricIdentityLinkDataManager historicIdentityLinkDataManager) {
    super(processEngineConfiguration);
    this.historicIdentityLinkDataManager = historicIdentityLinkDataManager;
  }

  protected DataManager<HistoricIdentityLinkEntity> getDataManager() {
    return this.historicIdentityLinkDataManager;
  }

  public List<HistoricIdentityLinkEntity> findHistoricIdentityLinksByTaskId(String taskId) {
    return this.historicIdentityLinkDataManager.findHistoricIdentityLinksByTaskId(taskId);
  }

  public List<HistoricIdentityLinkEntity> findHistoricIdentityLinksByProcessInstanceId(String processInstanceId) {
    return this.historicIdentityLinkDataManager.findHistoricIdentityLinksByProcessInstanceId(processInstanceId);
  }

  public void deleteHistoricIdentityLinksByTaskId(String taskId) {
    List<HistoricIdentityLinkEntity> identityLinks = this.findHistoricIdentityLinksByTaskId(taskId);
    Iterator var3 = identityLinks.iterator();

    while(var3.hasNext()) {
      HistoricIdentityLinkEntity identityLink = (HistoricIdentityLinkEntity)var3.next();
      this.delete(identityLink);
    }

  }

  public void deleteHistoricIdentityLinksByProcInstance(String processInstanceId) {
    List<HistoricIdentityLinkEntity> identityLinks = this.historicIdentityLinkDataManager.findHistoricIdentityLinksByProcessInstanceId(processInstanceId);
    Iterator var3 = identityLinks.iterator();

    while(var3.hasNext()) {
      HistoricIdentityLinkEntity identityLink = (HistoricIdentityLinkEntity)var3.next();
      this.delete(identityLink);
    }

  }

  public HistoricIdentityLinkDataManager getHistoricIdentityLinkDataManager() {
    return this.historicIdentityLinkDataManager;
  }

  public void setHistoricIdentityLinkDataManager(HistoricIdentityLinkDataManager historicIdentityLinkDataManager) {
    this.historicIdentityLinkDataManager = historicIdentityLinkDataManager;
  }
}
